// @ts-ignore
import axiosInstance from "~/api";

export const userLogin = (params: any) => {
    return axiosInstance.post('/users/login', params)
}

export const userLogout = () => {
    return axiosInstance.post('/users/logout')
}

export const userRegister = (params: any) => {
    return axiosInstance.post('/users/register', params)
}

export const userUpdatePassword = (params: any) => {
    return axiosInstance.put('/users/password', params)
}

export const sendValidationCode = (username: any) => {
    return axiosInstance.get('/users/code', {
        params: {
            username: username
        }
    })
}

export const userWxIsLogin = (params: any) => {
    return axiosInstance.get('/wx/wechatIsLogin', {params})
}

export const userWechatLoginCode = () => {
    return axiosInstance.get('/wx/wechatLoginCode')
}

export const getUserInfoById = (id: any) => {
    return axiosInstance.get('/users/info/' + id)
}
